/*
 * File:   SceneInitializer.h
 * Author: Elevator
 *
 * Created on 13 Июнь 2013 г., 23:54
 */

#ifndef INITIALIZER_H
#define INITIALIZER_H

#include <string>
#include "Core/Core.h"
#include "Data/Data.h"
#include "Scene.h"
#include "Logic/Factory.h"
#include "Logic/Creature/Creature.h"
#include "Logic/Creature/Detail.h"
#include "Logic/Creature/Junction.h"
#include "Logic/Map/Ground.h"
#include "Logic/Map/Grid.h"
#include "Logic/Player/IPlayer.h"
#include "Logic/Player/EmptyPlayer.h"
#include "Logic/Player/HumanPlayer.h"

class Initializer
{
public:
	Scene* Initialize( std::string sceneFilename );

private:
	std::map<std::string, IPart*> _parts;
	std::map<std::string, Detail*> _details;
	std::map<std::string, Junction*> _junctions;
	std::map<std::string, Creature*> _creatures;

	Scene* CreateScene( const data::Scene* dataScene );
	Camera* CreateCamera( const data::Camera* dataCamera );
	Map* CreateMap( const data::Map* dataMap );
	Obstacle* CreateObstacle( const data::Obstacle* dataObstacle );
	Rule CreateRule( const data::Rule& dataRule );
	Junction* CreateJunction( const Transform& creaturePos, const data::Rotor* dataRotor );
	Detail* CreateDetail( const Transform& creaturePos, const data::Detail* dataDetail );
	Creature* CreateCreature( const data::Creature* dataCreature );
	IPlayer* CreatePlayer( const data::Player& dataPlayer );
};

#endif	/* SCENEINITIALIZER_H */

